home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / cracking software / word list maker.zip / dictmake.c next >
C/C++ Source or Header  |  1997-11-09  |  2KB  |  83 lines

  1. /*
  2. DictMaker v1.0
  3. Written By: E-HACK (god@wilter.com)
  4.  
  5. Copyright ⌐ 1997 Wiltered Fire
  6. All Rights Reserved.
  7.  
  8. If you use any ideas/code from this in a prog, gimme credit...
  9.  
  10.  
  11. */
  12.  
  13.  
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <time.h>
  18.  
  19. static char *letters[] = { "a","b","c","d","e","f","g","h","i","j","k","l","m",
  20.             "n","o","p","q","r","s","t","u","v","w","x","y","z","A",
  21.             "B","C","D","E","F","G","H","I","J","K","L","M","N","O",
  22.             "P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2",
  23.             "3","4","5","6","7","8","9" };
  24.                                                         
  25. main()
  26. {
  27. int i, chars, c, passwords, d;
  28. char *letter, *filename;
  29. FILE *fp;
  30. time_t t;
  31.  
  32. srand((unsigned) time(&t));
  33.  
  34. printf("\n DictMaker v1.0\n Written By: E-HACK\n\n");
  35.  
  36. printf(" Output file: ");
  37. scanf("%s", filename);
  38.  
  39. printf(" Number of characters: ");
  40. scanf("%d", &chars);
  41.  
  42. if(chars <= 1) {
  43. printf(" Not enough characters!");
  44. return(0);
  45. }
  46.  
  47. printf(" Number of passwords: ");
  48. scanf("%d", &passwords);
  49.  
  50. if(passwords <= 1) {
  51. printf(" Not enough paswords!");
  52. return(0);
  53. }
  54.  
  55. d = 1;
  56. fp = fopen(filename, "w");
  57. fflush(fp);
  58. if(fp == NULL) {
  59. printf("\n Unable to write to %s", filename);
  60. return(0);
  61. }
  62. printf("\n Creating %s with %d passwords", filename, passwords);
  63. if(passwords >= 20000) { printf("...\n This might take a while"); }
  64.  
  65.  
  66. while(d <= passwords)
  67. {
  68. d++;
  69.  
  70. c = 1;
  71. while(c <= chars)
  72. {
  73. c++;
  74. i = rand() % 62;
  75. letter = letters[i];
  76. fprintf(fp, "%s", letter);
  77. }
  78. fputs("\n", fp);
  79. }
  80. fclose(filename);
  81. printf("\n\n Done writing %d passwords to %s\a", passwords, filename);
  82. return(0);
  83. }